#include <miko/defines.h>
#include <wchar.h>

/* A simple array to hold human readable versions of error messages.
 * These are mapped by abs.
 */
const char * miko_get_error_string(int error_code) {
	const char * error;
	switch(error_code) {
	case MIKO_SUCCESS: error = "No error"; break;
	case MIKO_ERROR: error = "General error"; break;
	case MIKO_TIMEOUT: error = "Network timeout"; break;
	case MIKO_POLLERROR: error = "Error polling socket"; break;
	case MIKO_SEND_FAILED: error = "Error sending data"; break;
	case MIKO_MSG_TOO_LONG: error = "Message is too long"; break;
	case MIKO_DATA_CHECK_FAILURE: error = "Length header does not match anticipated data"; break;
	case MIKO_INVALID_UNICODE:  error = "Invalid unicode string"; break;
	default: error = "Invalid error code"; break;
	}

	return error;
}
